namespace test { public class Class1 { public string[] AllNameSpace() { return Assembly.GetExecutingAssembly().GetTypes().Select(x => x.Namespace).ToArray(); } } }